﻿using System;
using System.ComponentModel;
using Beaker.OpenCube.Game;
using OpenCube.Model.Primitives.Converters;
using OpenCube.Nbt.Mapping.Attributes;

namespace OpenCube.Model
{
	public sealed class WorldBorderDat
	{
		/// <summary>
		/// Gets or sets the center position of the border
		/// </summary>
		[NbtConverter(typeof(CoordinatesConverter))]
		[NbtName("BorderCenterX", "BorderCenterZ")]
		public Coordinates2<double> BorderCenter { get; set; }

		[Nbt]
		[DefaultValue(60000000d)]
		public double BorderSize { get; set; }

		[Nbt]
		[DefaultValue(5d)]
		public double BorderSafeZone { get; set; }

		[Nbt]
		[DefaultValue(5d)]
		public double BorderWarningBlocks { get; set; }

		[Nbt]
		[DefaultValue(typeof(TimeSpan), "00:00:15")]
		[NbtConverter(typeof(TimeSpanSecondsConverter))]
		public TimeSpan BorderWarningTime { get; set; }

		[Nbt]
		[DefaultValue(60000000d)]
		public double BorderSizeLerpTarget { get; set; }

		[Nbt]
		public TimeSpan BorderSizeLerpTime { get; set; }

		[Nbt]
		[DefaultValue(0.2d)]
		public double BorderDamagePerBlock { get; set; }

	}
}